<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SB Admin 2 - Bootstrap Admin Theme</title>

    <!-- Bootstrap Core CSS -->
    <link href="/adminCSS/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="/adminCSS/bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="/adminCSS/dist/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="/adminCSS/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

    <div class="container">
        <div class="row">
            <div class="col-md-4 col-md-offset-4">
                <div class="login-panel panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">后台</h3>
                    </div>
                    <div class="panel-body">
                        <form id="tj" onclick="return false" method="post" action="/admin/user/up">
                                        {{ csrf_field() }}
                            <fieldset>
                                <div class="form-group">
                                    <input class="form-control" placeholder="用户名" name="name" type="text" autofocus>
                                    <label><span style="display:none">请填写用户名</span></label>
                                     <label><span id='n' style="display:none">用户名不正确</span> </label>
                                </div>
                                <div class="form-group">
                                    <input class="form-control" placeholder="密码" name="password" type="password" value="">
                                    <label><span style="display:none">请填写密码</span></label>
                                    <label><span id='p' style="display:none">密码不正确</span></label>
                                </div>
                                <div class="checkbox">
                                </div>
                                <button id="btn" type="submit" class="btn btn-primary btn-lg btn-block">登陆</button>
                            </fieldset>
                        </form>
                        <script src="/adminCSS/bower_components/jquery/dist/jquery.min.js"></script>
                        <script>
                             $('#btn').click(function(){

                                  var name=$('input[name=name]').val();
                                  var password= $('input[name=password]').val();
                                  // alert(name);
                                  // console.log(btn);
                                  $.ajax({
                                  url:'/admin/user/login',
                                  data:{name:name,password:password},
                                  type:'get',
                                  success:function(data){
                                    // alert(data);
                                     if (data==1) {
                                      $('#n').removeAttr('style');
                                    }else if(data==2){
                                      $('#p').removeAttr('style');
                                    }else if(data==3){
                                        var btn=$('#tj').removeAttr('onclick');
                                    }
                                  }
                                 
                                  })
                              })
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- jQuery -->
   

</body>

</html>
